#include "Filters/RIVIABlur.h"
#include "IRIVIAProject.h"
#include "opencv2/core.hpp"
#include "opencv2/imgproc.hpp"
#include <QTime>
#include <QDebug>

RIVIABlur::RIVIABlur()
{

}

RIVIABlur::~RIVIABlur()
{

}

void RIVIABlur::blurWithGaussianBlur(int w, int h)
{
    auto startTime = QTime::currentTime();
    cv::Mat src = IRIVIAProject::getInstance()->getCurMat();
    cv::Mat dst = IRIVIAProject::getInstance()->getCurMatProc();

    cv::GaussianBlur(src, dst, cv::Size(w, h), 0, 0);
    qDebug()<<"GaussianBlur eclipse:  "<< startTime.msecsTo(QTime::currentTime())<<" ms";
}

void RIVIABlur::finishBlur()
{
    IRIVIAProject::getInstance()->updateImageByImageProc();
}
